﻿<%@ Page Language="C#" Title="路面结构强度监测" MasterPageFile="~/W_View/PageMaster.Master" CodeBehind="S_RdpssiPage.aspx.cs" Inherits="STHPMS1.Web.W_View.Survey.S_RdpssiPage" %>

<asp:Content ID="Content1" ContentPlaceHolderID="head" runat="Server">
    <%= UiHelper.RefJsFileHtml("/Scripts/Control/datagrid.js")%>
    
    <%= UiHelper.RefJsFileHtml("/Scripts/Control/dropdown.js")%>    
    <%= UiHelper.RefJsFileHtml("/Scripts/TypeScript/Enum.js")%>
    <%= UiHelper.RefJsFileHtml("/Scripts/TypeScript/Bussiness.js")%>

    <script type="text/javascript">      

		function S_RdpssiEdit(flag)
		{
		    var row = $('#dg').datagrid('getSelected');
		    if (!row) {
		        $.messager.alert('消息提示', '编辑数据时，请选择一项!', 'warning');
		        return;
		    }


            $('#fm').form('clear');
            $('#fm').form('load', row);
            $('#dlg').dialog('open');
        }

        function S_RdpssiDel() {
            var row = $('#dg').datagrid('getSelected');
            if (!row) {
                $.messager.alert('消息提示', '删除数据时，请选择一项!', 'warning');
                return;
            }

            deleteData($('#dg'), $('#dlg'), "/api/rdpssi");
        }

		
        function search(n, o) {
            var road = $('#cmbRoads').combobox("getValue");
            var inspecid = $('#cmbInspecid').datebox('getValue');
            var checkDate = $('#checkDate').datebox('getValue');

            var url = '/api/rdpssi';
            var urlParam = "";
            if (road != "" && road != "0") urlParam += "road=" + encodeURI(road) + "&";
            if (inspecid != "" && inspecid != "0") urlParam += "inspecid=" + encodeURI(inspecid) + "&";
            if (checkDate != "") urlParam += "checkDate=" + encodeURI(checkDate) + "&";
            if (urlParam != "") {
                urlParam = "?" + urlParam.substring(0, urlParam.length - 1);
                url = url + urlParam;
            }

            $('#dg').datagrid({ url: url, pageNumber: 1 });
        }

        $(function () {
            var number= '<%= Page.RouteData.Values["page"] %>';
            var size = '<%= Page.RouteData.Values["size"] %>';

            dataGridBind($('#dg'), '/api/rdpssi', '路面结构强度列表显示', $('#tb'), number, size);

            $('.validatebox-text').bind('blur', function () {
                $(this).validatebox('enableValidation').validatebox('validate');
            });
        })

        
    </script>    
</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="ContentPlaceHolder1" runat="Server">
    <table id="dg" class="easyui-datagrid content-place"  ajaxCached="false"  >
        <thead>
            <tr>
                <th data-options="field:'Unit',editor:'text',width:120,align:'center' ,hidden:true">单元ID</th>
                <th data-options="field:'Inspecid',editor:'text',width:120,align:'center',hidden:true ">检测名称</th>
                <th data-options="field:'Name',editor:'text',width:80,align:'center' ">单元</th>
                <th data-options="field:'Rdwayid',editor:'text',width:80,align:'center' ">路线编号</th>
                <th data-options="field:'Direction_Dictid',editor:'numberbox',width:80,align:'center'" formatter="formatDirection">行车方向</th>
                <th data-options="field:'His_Version',editor:'numberbox',width:80,align:'center' ,hidden:true">养护版本</th>
                <th data-options="field:'Pssidate',editor:'datebox',width:80,align:'center' "  formatter="formatDate">调查日期</th>
                <th data-options="field:'Surveyer',editor:'text',width:150,align:'right' ">检测人员</th>
                <th data-options="field:'Device',editor:'text',width:150,align:'right' ">检测设备</th>
                <th data-options="field:'Lfdefl',editor:'numberbox',width:150,align:'right' ">左弯沉(0.01mm)</th>
                <th data-options="field:'Rgdefl',editor:'numberbox',width:150,align:'right' ">右弯沉(0.01mm)</th>
                <th data-options="field:'Repdefl',editor:'numberbox',width:150,align:'right' ">实测代表弯沉(0.01mm)</th>
                <th data-options="field:'Ssi',editor:'numberbox',width:150,align:'right' ">路面结构强度系数SSI</th>
                <th data-options="field:'Importdate',editor:'datebox',width:150,align:'right' ,hidden:true">导入时间</th>
            </tr>            
        </thead>
    </table>
   
     <div id="tb">
        <a href="javascript:void(0)" class="easyui-linkbutton" data-options="iconCls:'icon-add',plain:true" onclick="S_RdpssiEdit(-1)">编辑</a>
        <a href="javascript:void(0)" class="easyui-linkbutton" data-options="iconCls:'icon-remove',plain:true" onclick="S_RdpssiDel()">删除</a>
        <select id="cmbRoads" class="easyui-combobox" panelHeight="80" style="width:100px" data-options="prompt:'路线编号',url:'/api/roadway/dict',method:'get',valueField:'id',textField:'id',onChange:search">
        </select>
         <select id="cmbInspecid" class="easyui-combobox" panelHeight="80" style="width:100px" data-options="prompt:'调查年月',url:'/api/S_Inspeaccse/all',method:'get',valueField:'Inspecid',textField:'Inspecid',onChange:search">
         </select>
	    <input id="checkDate" class="easyui-datebox"  data-options="prompt:'观测日期',onChange:search"/>
    </div>

    <div id="dlg" class="easyui-dialog" title="保存数据" style="width:400px;height:400px;padding:10px" closed="true"  data-options="
				iconCls: 'icon-save',
				buttons: '#dlg-buttons'
			">
        <form id="fm" method="post" action="/api/rdpssi">
            <table>
                 <tr  style="display:none">
                    <td>单元ID:</td>     
                    <td><input name='Unit'  class="easyui-textbox" data-options="required:true,readonly:true"/></td>   
                </tr>           
                <tr>
                    <td>检测名称:</td>
                    <td><input name='Inspecid'  class="easyui-textbox" data-options="required:true,readonly:true"/></td>
                </tr>                
                <tr>
                    <td>单元名称:</td>        
                    <td><input name='Name'  class="easyui-textbox" data-options="required:true,readonly:true" /></td>
                </tr>                  	     
                <tr>
                   <td>路线编号:</td>
                    <td><input name='Rdwayid'  class=" easyui-combobox" data-options="required:true,readonly:true,valueField:'Rdwayid',textField:'Name',panelHeight:'auto',url:'/api/roadway/all',method:'get'"/></td>
                </tr>	
                 <tr>
                    <td>行车方向:</td>
                     <td><input  name='Direction_Dictid' class=' easyui-combobox'  data-options="required:true,readonly:true,valueField:'id',textField:'text',panelHeight:'auto',url:'/api/data/direction',method:'get'" /></td>
                </tr>                  
                 <tr style="display:none">
                    <td>养护版本:</td>
                    <td><input name='His_Version' class='easyui-numberbox' data-options="required:true,readonly:true"/></td>
                </tr>    
                <tr>
                    <td>调查日期:</td>
                    <td><input name='Pssidate' class='easyui-validatebox easyui-datebox'  data-options="required:true,readonly:true"/></td>
                </tr>
                <tr>
                    <td>检测人员:</td>
                    <td><input name='Surveyer' class='easyui-validatebox easyui-textbox' data-options="validType:'MaxLength[50]'" /></td>
                </tr>
                <tr>
                    <td>检测设备:</td>
                    <td><input name='Device' class='easyui-validatebox easyui-textbox'  data-options="required:true,validType:'MaxLength[50]'" /></td>
                </tr>
                <tr>
                    <td>左弯沉(0.01mm):</td>
                    <td><input name='Lfdefl' class='easyui-validatebox easyui-numberbox'  data-options='min:0,precision:2' /></td>
                </tr>
                <tr>
                    <td>右弯沉(0.01mm):</td>
                    <td><input name='Rgdefl' class='easyui-validatebox easyui-numberbox'  data-options='min:0,precision:2' /></td>
                </tr>
                <tr>
                    <td>实测代表弯沉(0.01mm):</td>
                    <td><input name='Repdefl' class='easyui-validatebox easyui-numberbox'  data-options='min:0,precision:2' /></td>
                </tr>
                <tr>
                    <td>路面结构强度系数SSI:</td>
                    <td><input name='Ssi' class='easyui-validatebox easyui-numberbox'  data-options='min:0,precision:2' /></td>
                </tr>
                <tr  style="display:none">
                    <td>导入时间:</td>
                    <td><input name='Importdate' class='easyui-validatebox easyui-datebox'  /></td>
                </tr>

		    </table>
        </form>
    </div>

    <!--编辑数据命令-->
    <div id="dlg-buttons">
		<a href="javascript:void(0)" class="easyui-linkbutton" onclick="javascript:sumbitData($('#dg'),$('#dlg'))">保存</a>
		<a href="javascript:void(0)" class="easyui-linkbutton" onclick="javascript:$('#dlg').dialog('close')">取消</a>
	</div>
</asp:Content>
